<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			
			function Worker(){
				var i = 10;
				
				this.getI = function(){
					return i;
				}
				this.sal = 1500;
			}
			
			Worker.prototype = {
				name:"james",
				age:30,
				id:1,
			}
			
			var worker = new Worker();
			console.log(worker.sal);
			console.log(worker.constructor);
			
		/* 	function Student(){
				this.score = 100;
			}
			var person ={
				name:"tom",
				age:20,
				id:1,
				hi:function(){
					alert("你好");
				}
			}
			Student.prototype = person;
			
			var stu1 = new Student();
			console.log(stu1.name);
			stu1.hi();
			console.log(stu1.score); */
			
			
			
			
			
			/* var obj = new Object;
			obj["first name"] = "tom"
			console.log(obj["first name"]); */
			
			
			
			
			
			
			
			/* function Student(){
				this.name = "tom";
				this.age =30;
				this.hi = function(){
					alert("你好");
				}
			}
			
			Student.prototype.id = 1;
			
			var stu1 = new Student();
			console.log(stu1.name);
			console.log(stu1.age);
			console.log(stu1.id);
			stu1.hi(); */
			
			
			
			
			
			
			
			
			
		/* 	var o = new Object();
			o.name = "tom";;
			o.age = 20;
			console.log(o.name);
			console.log(o.age);
			o.hi = function(){
				alert("hi");
			}
			o.hi(); */
		</script>
	</head>
	<body>
	</body>
</html>
